﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace NexTrackDesktopTest
{
    static class Util
    {
        public static void AssertAllEqual<T>(IEnumerable<T> expected, IEnumerable<T> actual)
        {
            IEnumerator<T> e1, e2;
            e1 = expected.GetEnumerator();
            e2 = actual.GetEnumerator();

            while (true)
            {
                if (e1.MoveNext())
                    Assert.IsTrue(e2.MoveNext(), "list1 and list2 are not of the same length.");
                else
                {
                    Assert.IsFalse(e2.MoveNext(), "list1 and list2 are not of the same length.");
                    break;
                }

                Assert.AreEqual(e1.Current, e2.Current);
            }
        }
    }
}
